import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/http";

// export type CouponItemLimit = {
//     _id?: string,
//     is_show: number,
//     name: string,
//     grade: string,
//     discount: string,
//     exp: string
// }
export type CouponSendWayItemLimit = {
    _id: string,
    name: string,
    sendWayId: string,
    price: string,
    use_sill: number,
    userTypeId: string,
    typeId: string,
    min_price: number,
    get_time_limit: number
}

export function addCouponApi(data: object) {
    return httpPost('/coupon/add', data);
}
export function getCouponApi(data?: object) {
    return httpPost('/coupon/find', data);
}
export function updateCouponApi(data: object) {
    return httpPut('/coupon/update', data);
}
export function deleteCouponApi(data: object) {
    return httpDelete('/coupon/remove', data);
}
export function getCouponByIdApi(data: object) {
    return httpGet('/coupon/getById', data);
}
//获取优惠券发送方式请求
export function getCouponSendWayApi(data?: object) {
    return httpPost('/couponSendWay/find', data);
}
